
/****** Object:  Table [dbo].[s_questionnaire]    Script Date: 10/04/2012 22:01:13 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[s_questionnaire](
	[questionnaire_id] [int] IDENTITY(1,1) NOT NULL,
	[questionnaire_title] [nvarchar](100) NOT NULL,
	[questionnaire_summary] [nvarchar](max) NULL,
	[active] [bit] NULL,
	[create_user] [nvarchar](50) NULL,
	[create_time] [datetime] NULL,
	[questionnaire_setting] [varchar](50) NULL,
	[questionnaire_type] [int] NULL,
 CONSTRAINT [PK_s_questionnaire] PRIMARY KEY CLUSTERED 
(
	[questionnaire_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

CREATE TABLE [dbo].[s_question_type](
	[question_type_id] [int] NULL,
	[question_type_name] [nvarchar](50) NULL,
	[question_type_describe] [nvarchar](50) NULL
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[s_question](
	[question_id] [int] IDENTITY(1,1) NOT NULL,
	[questionnaire_id] [int] NULL,
	[question_content] [nvarchar](max) NULL,
	[question_type] [int] NULL,
	[question_module] [nvarchar](100) NULL,
	[active] [bit] NULL,
	[question_setting] [varchar](50) NULL,
 CONSTRAINT [PK_s_question] PRIMARY KEY CLUSTERED 
(
	[question_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[s_option](
	[option_id] [int] IDENTITY(1,1) NOT NULL,
	[questionnaire_id] [int] NOT NULL,
	[question_id] [int] NOT NULL,
	[option_content] [nvarchar](1000) NULL,
	[option_type] [varchar](50) NULL,
	[option_setting] [varchar](50) NULL,
	[option_value] [int] NULL,
 CONSTRAINT [PK_s_option] PRIMARY KEY CLUSTERED 
(
	[option_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[s_answer](
	[questionnaire_id] [int] NULL,
	[question_id] [int] NULL,
	[answer_selection] [int] NULL,
	[answer_selection_value] [int] NULL,
	[answer_text] [ntext] NULL,
	[customer_ip] [varchar](50) NULL,
	[answer_time] [datetime] NULL,
	[customer_id] [varchar](50) NULL,
	[service_id] [varchar](50) NULL,
	[prod_id] [int] NULL,
	[answer_id] [int] IDENTITY(1,1) NOT NULL,
	[service_log_id] [bigint] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO



